<?php

class DomObjDefinition implements IDomObjDefinition
{

  /**
   *
   * @var string
   */
  protected $class;

  /**
   *
   * @var string
   */
  protected $name;

  /**
   *
   * @param string $class
   * @return void
   */
  public function __construct($name)
  {
    $this->name = $name;
  }

  /**
   * (non-PHPdoc)
   * @see simplify/kernel/domain/api/IDomObjDefinition#getName()
   */
  public function getName()
  {
    return $this->name;
  }

  /**
   * (non-PHPdoc)
   * @see simplify/kernel/domain/api/IDomObjDefinition#getClass()
   */
  public function getClass()
  {
    if (empty($this->class)) {
      $this->class = $this->getName();
    }

    return $this->class;
  }

  /**
   * (non-PHPdoc)
   * @see simplify/kernel/domain/api/IDomObjDefinition#factory()
   */
  public function factory()
  {
    $class = $this->getClass();
    $obj = new $class();
    return $obj;
  }

}

?>